import Mock from 'mockjs'
import loginAPI from './login'
import articleAPI from './article'
import remoteSearchAPI from './remoteSearch'
import transactionAPI from './transaction'

// 添加开始
import applyAPI from './apply'
// 添加结束

// Mock.setup({
//   timeout: '350-600'
// })

// 登录相关
Mock.mock(/\/service\/login/, 'post', loginAPI.loginByUsername)
Mock.mock(/\/service\/logout/, 'post', loginAPI.logout)
Mock.mock(/\/service\/user\.*/, 'get', loginAPI.getUserInfo)

// 文章相关
Mock.mock(/\/article\/list/, 'get', articleAPI.getList)
Mock.mock(/\/article\/detail/, 'get', articleAPI.getArticle)
Mock.mock(/\/article\/pv/, 'get', articleAPI.getPv)
Mock.mock(/\/article\/create/, 'post', articleAPI.createArticle)
Mock.mock(/\/article\/update/, 'post', articleAPI.updateArticle)

// 搜索相关
Mock.mock(/\/search\/user/, 'get', remoteSearchAPI.searchUser)

// 账单相关
Mock.mock(/\/transaction\/list/, 'get', transactionAPI.getList)

// 比赛申请相关
Mock.mock(/\/apply\/config/, 'get', applyAPI.getConfig)
Mock.mock(/\/config\/game/, 'get', applyAPI.getGameType)
Mock.mock(/\/apply/, 'post', applyAPI.createApply)
Mock.mock(/\/apply/, 'put', applyAPI.updateApply)

export default Mock
